<div class="inner-form">
    <div class="box box-100">
        <div class="boxin">
            <div class="header">
                <h1>Groups</h1>
                <a class="button altbutton" href="/backoffice/group/create">Add group</a>
            </div>
            
            <div class="content">
                <table width="100%">
                    <?php if (count($this->groups)) { ?>
                        <thead>
                            <tr>
                                <th>Group</th>
                                <th>Parent group</th>
                                <td class="tc last">Actions</td>
                            </tr>
                        </thead>

                        <tbody>
                            <?php foreach ($this->groups as $group) { ?>
                                <tr>
                                    <td><?= $group->getName()?></td>
                                    <td>
                                        <?php if($group->getParent() !== null) {?>
                                            <?= $group->getParent()->getName() ?>
                                        <?php } else {?>
                                        -
                                        <?php } ?>
                                    </td>
                                    <td class="tc last">
                                        <ul class="actions">
                                            <li><a class="ico" title="Edit" href="/backoffice/group/update/id/<?= $group->getId() ?>"><img alt="edit" src="/images/fff/pencil.png" /></a></li>
                                            <li><a class="ico" title="Delete" href="/backoffice/group/delete/id/<?= $group->getId() ?>"><img alt="delete" src="/images/fff/cross.png" /></a></li>
                                            <li><a class="ico" title="Edit flippers" href="/backoffice/group/flippers/id/<?= $group->getId() ?>"><img alt="delete" src="/images/led-ico/user.png" /></a></li>
                                        </ul>
                                    </td>
                                </tr>
                            <?php } ?>
                        </tbody>
                    <?php } ?>
                </table>
                <?php
                    echo $this->paginationControl($this->groups,
                                                  'Sliding',
                                                  'partials/pagination.phtml');
                ?>
            </div>
        </div>
    </div>
</div>